<?php
/**
 * Element formulara
 * @author Tomas Srna
 * @package bakalarka
 */

class Element
{
	/**
	 * @var string $name Nazov elementu
	 */
	public $name;
	
	/**
	 * @var string $label Popis elementu
	 */
	public $label;
	
	/**
	 * @var string $hint Napoveda pod elementom
	 */
	public $hint;
	
	/**
	 * @var string $type Jedno z: text, password, select, multiselect, textarea
	 */
	public $type;
	
	/*
	 * @var string $class Trieda elementu, pouzita aj pri validacii
	 * 		Moznosti: required, readonly, disabled,
	 * 					numeric, nospace, email
	 */
	public $class;
	
	public $options = array();
	
	public $maxlen = 0;
	
	public function __construct($name, $label, $type = "text", $class = "", 
		$hint = "", $options = NULL, $maxlen = 30)
	{
		$this->name = $name;
		$this->label = $label;
		$this->hint = $hint;
		$this->type = $type;
		$this->class = $class;
		$this->options = $options;
		$this->maxlen = $maxlen;
	} 
}
